import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class SimpleGui extends Application {

    @Override
    public void start(Stage primaryStage) {
        Label label = new Label("Hello, World!");

        Button button = new Button("Click Me");

        button.setOnAction(e -> {
            label.setText("Button Clicked!");
        });

        // 创建一个垂直布局容器
        VBox layout = new VBox(10);
        layout.setPadding(new Insets(10));
        layout.getChildren().addAll(label, button);

        // 创建一个场景
        Scene scene = new Scene(layout, 320, 170);

        // 设置舞台的标题和场景
        primaryStage.setTitle("Simple GUI");
        primaryStage.setScene(scene);

        // 显示舞台
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
